80382b7c: 27 bd ff 80  ADDIU sp, sp, 0xffffff80 (-128)
80382b80: af bf 00 34  SW ra, sp, 0x34 (52)
80382b84: af a4 00 80  SW a0, sp, 0x80 (128)                   [sp + 0x80] === arg1
80382b88: af a5 00 84  SW a1, sp, 0x84 (132)                   [sp + 0x84] === arg2
80382b8c: af b7 00 30  SW s7, sp, 0x30 (48)
80382b90: af b6 00 2c  SW s6, sp, 0x2c (44)
80382b94: af b5 00 28  SW s5, sp, 0x28 (40)
80382b98: af b4 00 24  SW s4, sp, 0x24 (36)
80382b9c: af b3 00 20  SW s3, sp, 0x20 (32)
80382ba0: af b2 00 1c  SW s2, sp, 0x1c (28)
80382ba4: af b1 00 18  SW s1, sp, 0x18 (24)
80382ba8: af b0 00 14  SW s0, sp, 0x14 (20)

80382bac: 8f ae 00 84  LW t6, sp, 0x84 (132)
80382bb0: 8d cf 00 00  LW t7, t6, 0x0 (0)
80382bb4: 85 f8 00 00  LH t8, t7, 0x0 (0)                      t8 = (*arg2)[0]
80382bb8: 00 18 c8 80  SLL t9, t8, 0x2 (2)                     t9 = (*arg2)[0] * 4
80382bbc: 03 38 c8 23  SUBU t9, t9, t8                         t9 = t9-t8 = (*arg2)[0] * 3
80382bc0: a7 b9 00 3e  SH t9, sp, 0x3e (62)                [sp + 0x3e] = (*arg2)[0] *3;

80382bc4: 8f a8 00 84  LW t0, sp, 0x84 (132)
80382bc8: 8d 09 00 00  LW t1, t0, 0x0 (0)
80382bcc: 85 2a 00 02  LH t2, t1, 0x2 (2)
80382bd0: 00 0a 58 80  SLL t3, t2, 0x2 (2)
80382bd4: 01 6a 58 23  SUBU t3, t3, t2
80382bd8: a7 ab 00 3c  SH t3, sp, 0x3c (60)                [sp + 0x3c] = (*arg2)[1] *3;

80382bdc: 8f ac 00 84  LW t4, sp, 0x84 (132)
80382be0: 8d 8d 00 00  LW t5, t4, 0x0 (0)
80382be4: 85 ae 00 04  LH t6, t5, 0x4 (4)
80382be8: 00 0e 78 80  SLL t7, t6, 0x2 (2)
80382bec: 01 ee 78 23  SUBU t7, t7, t6
80382bf0: a7 af 00 3a  SH t7, sp, 0x3a (58)                [sp + 0x3a] = (*arg2)[2] *3;

80382bf4: 87 b9 00 3e  LH t9, sp, 0x3e (62)
80382bf8: 8f b8 00 80  LW t8, sp, 0x80 (128)
80382bfc: 00 19 40 40  SLL t0, t9, 0x1 (1)                     t0 = [sp + 0x3e]*2 = (*arg2)[0] * 6
80382c00: 03 08 48 21  ADDU t1, t8, t0
80382c04: 85 30 00 00  LH s0, t1, 0x0 (0)                  s0 = arg1[[sp + 0x3e]];

80382c08: 87 ab 00 3e  LH t3, sp, 0x3e (62)
80382c0c: 8f aa 00 80  LW t2, sp, 0x80 (128)
80382c10: 00 0b 60 40  SLL t4, t3, 0x1 (1)
80382c14: 01 4c 68 21  ADDU t5, t2, t4
80382c18: 85 b1 00 02  LH s1, t5, 0x2 (2)                  s1 = arg1[[sp + 0x3e] + 1];

80382c1c: 87 af 00 3e  LH t7, sp, 0x3e (62)
80382c20: 8f ae 00 80  LW t6, sp, 0x80 (128)
80382c24: 00 0f c8 40  SLL t9, t7, 0x1 (1)
80382c28: 01 d9 c0 21  ADDU t8, t6, t9
80382c2c: 87 12 00 04  LH s2, t8, 0x4 (4)                  s2 = arg1[[sp + 0x3e] + 2];

80382c30: 87 a9 00 3c  LH t1, sp, 0x3c (60)
80382c34: 8f a8 00 80  LW t0, sp, 0x80 (128)
80382c38: 00 09 58 40  SLL t3, t1, 0x1 (1)
80382c3c: 01 0b 50 21  ADDU t2, t0, t3
80382c40: 85 53 00 00  LH s3, t2, 0x0 (0)                  s3 = arg1[[sp + 0x3c]];

80382c44: 87 ad 00 3c  LH t5, sp, 0x3c (60)
80382c48: 8f ac 00 80  LW t4, sp, 0x80 (128)
80382c4c: 00 0d 78 40  SLL t7, t5, 0x1 (1)
80382c50: 01 8f 70 21  ADDU t6, t4, t7
80382c54: 85 d4 00 02  LH s4, t6, 0x2 (2)                  s4 = arg1[[sp + 0x3c] + 1];

80382c58: 87 b8 00 3c  LH t8, sp, 0x3c (60)
80382c5c: 8f b9 00 80  LW t9, sp, 0x80 (128)
80382c60: 00 18 48 40  SLL t1, t8, 0x1 (1)
80382c64: 03 29 40 21  ADDU t0, t9, t1
80382c68: 85 15 00 04  LH s5, t0, 0x4 (4)                  s5 = arg1[[sp + 0x3c] + 2];

80382c6c: 87 aa 00 3a  LH t2, sp, 0x3a (58)
80382c70: 8f ab 00 80  LW t3, sp, 0x80 (128)
80382c74: 00 0a 68 40  SLL t5, t2, 0x1 (1)
80382c78: 01 6d 60 21  ADDU t4, t3, t5
80382c7c: 85 96 00 00  LH s6, t4, 0x0 (0)                  s6 = arg1[[sp + 0x3a]];

80382c80: 87 ae 00 3a  LH t6, sp, 0x3a (58)
80382c84: 8f af 00 80  LW t7, sp, 0x80 (128)
80382c88: 00 0e c0 40  SLL t8, t6, 0x1 (1)
80382c8c: 01 f8 c8 21  ADDU t9, t7, t8
80382c90: 87 37 00 02  LH s7, t9, 0x2 (2)                  s7 = arg1[[sp + 0x3a] + 1];

80382c94: 87 a8 00 3a  LH t0, sp, 0x3a (58)
80382c98: 8f a9 00 80  LW t1, sp, 0x80 (128)
80382c9c: 00 08 50 40  SLL t2, t0, 0x1 (1)
80382ca0: 01 2a 58 21  ADDU t3, t1, t2
80382ca4: 85 6d 00 04  LH t5, t3, 0x4 (4)
80382ca8: af ad 00 58  SW t5, sp, 0x58 (88)                [sp + 0x58] = arg1[[sp + 0x3a] + 2];

80382cac: 8f ae 00 58  LW t6, sp, 0x58 (88)
80382cb0: 02 91 60 23  SUBU t4, s4, s1                         t4 = s4 - s1          // y1 - y0
80382cb4: 02 b2 c8 23  SUBU t9, s5, s2                         t9 = s5 - s2          // z1 - z0
80382cb8: 01 d5 78 23  SUBU t7, t6, s5                         t7 = [sp + 0x58] - s5 // z2 - z1
80382cbc: 01 8f 00 19  MULTU t4, t7
80382cc0: 02 f4 40 23  SUBU t0, s7, s4                         t0 = s7 - s4          // y2 - y1
80382cc4: 00 00 c0 12  MFLO t8                                 t8 = (s4 - s1) * ([sp + 0x58] - s5) // (y1 - y0)(z2 - z1)
80382cc8: 00 00 00 00  NOP
80382ccc: 00 00 00 00  NOP
80382cd0: 03 28 00 19  MULTU t9, t0
80382cd4: 00 00 48 12  MFLO t1                                 t1 = (s5 - s2) * (s7 - s4)           // (z1 - z0)(y2 - y1)
80382cd8: 03 09 50 23  SUBU t2, t8, t1                         t2 = (s4 - s1)*([sp + 0x58] - s5)-(s5 - s2)*(s7 - s4) // (y1 - y0)(z2 - z1) - (z1 - z0)(y2 - y1)
80382cdc: 44 8a 20 00  MTC1 t2, f4
80382ce0: 00 00 00 00  NOP
80382ce4: 46 80 21 a0  CVT.S.W f6, f4
80382ce8: e7 a6 00 4c  SWC1 f6, sp, 0x4c (76)              [sp + 0x4c] = (float)((s4 - s1)*([sp + 0x58] - s5)-(s5 - s2)*(s7 - s4));

80382cec: 02 b2 58 23  SUBU t3, s5, s2                         t3 = s5 - s2          // z1 - z0
80382cf0: 02 d3 68 23  SUBU t5, s6, s3                         t5 = s6 - s3          // x2 - x1
80382cf4: 01 6d 00 19  MULTU t3, t5
80382cf8: 8f af 00 58  LW t7, sp, 0x58 (88)
80382cfc: 02 70 60 23  SUBU t4, s3, s0                         t4 = s3 - s0          // x1 - x0
80382d00: 01 f5 c8 23  SUBU t9, t7, s5                         t9 = [sp + 0x58] - s5 // z2 - z1
80382d04: 00 00 70 12  MFLO t6                                 t6 = (s5 - s2) * (s6 - s3) // (z1 - z0)(x2 - x1)
80382d08: 00 00 00 00  NOP
80382d0c: 00 00 00 00  NOP
80382d10: 01 99 00 19  MULTU t4, t9
80382d14: 00 00 40 12  MFLO t0                                 t0 = (s3 - s0) * ([sp + 0x58] - s5) // (x1 - x0)(z2 - z1)
80382d18: 01 c8 c0 23  SUBU t8, t6, t0
80382d1c: 44 98 40 00  MTC1 t8, f8
80382d20: 00 00 00 00  NOP
80382d24: 46 80 42 a0  CVT.S.W f10, f8
80382d28: e7 aa 00 48  SWC1 f10, sp, 0x48 (72)             [sp + 0x48] = (float)((s5 - s2)*(s6 - s3) - (s3 - s0)*([sp + 0x58] - s5));

80382d2c: 02 70 48 23  SUBU t1, s3, s0                         t1 = s3 - s0          // x1 - x0
80382d30: 02 f4 50 23  SUBU t2, s7, s4                         t2 = s7 - s4          // y2 - y1
80382d34: 01 2a 00 19  MULTU t1, t2
80382d38: 02 91 68 23  SUBU t5, s4, s1                         t5 = s4 - s1          // y1 - y0
80382d3c: 02 d3 78 23  SUBU t7, s6, s3                         t7 = s6 - s3          // x2 - x1
80382d40: 00 00 58 12  MFLO t3                                 t3 = (s3 - s0) * (s7 - s4) // (s3 - s0)(s7 - s4)
80382d44: 00 00 00 00  NOP
80382d48: 00 00 00 00  NOP
80382d4c: 01 af 00 19  MULTU t5, t7
80382d50: 00 00 60 12  MFLO t4                                 t4 = (s4 - s1) * (s6 - s3) // (s4 - s1)(s6 - s3)
80382d54: 01 6c c8 23  SUBU t9, t3, t4                         t9 = (s3 - s0)*(s7 - s4) - (s4 - s1)*(s6 - s3)
80382d58: 44 99 80 00  MTC1 t9, f16
80382d5c: 00 00 00 00  NOP
80382d60: 46 80 84 a0  CVT.S.W f18, f16
80382d64: e7 b2 00 44  SWC1 f18, sp, 0x44 (68)             [sp + 0x44] = (float)((s3 - s0)*(s7 - s4) - (s4 - s1)*(s6 - s3));

80382d68: c7 a4 00 4c  LWC1 f4, sp, 0x4c (76)
80382d6c: c7 a8 00 48  LWC1 f8, sp, 0x48 (72)
80382d70: c7 b2 00 44  LWC1 f18, sp, 0x44 (68)
80382d74: 46 04 21 82  MUL.S f6, f4, f4
80382d78: 00 00 00 00  NOP
80382d7c: 46 08 42 82  MUL.S f10, f8, f8
80382d80: 46 0a 34 00  ADD.S f16, f6, f10
80382d84: 46 12 91 02  MUL.S f4, f18, f18
80382d88: 0c 0c 8e 94  JAL 0x80323a50 (-2144191920)        [sp + 0x40] = sqrt([sp + 0x4c]*[sp + 0x4c] + [sp + 0x48]*[sp + 0x48] + [sp + 0x68]*[sp + 0x68]);
80382d8c: 46 04 83 00  ADD.S f12, f16, f4
80382d90: e7 a0 00 40  SWC1 f0, sp, 0x40 (64)

80382d94: af b1 00 50  SW s1, sp, 0x50 (80)                [sp + 0x50] = s1;

80382d98: 8f ae 00 50  LW t6, sp, 0x50 (80)
80382d9c: 02 8e 08 2a  SLT at, s4, t6
80382da0: 10 20 00 02  BEQ r0, at, 0x80382dac (pc + 0x8)   if (s4 >= [sp + 0x50]) goto 0x80382dac;
80382da4: 00 00 00 00  NOP

80382da8: af b4 00 50  SW s4, sp, 0x50 (80)                [sp + 0x50] = s4;

*
80382dac: 8f a8 00 50  LW t0, sp, 0x50 (80)
80382db0: 02 e8 08 2a  SLT at, s7, t0
80382db4: 10 20 00 02  BEQ r0, at, 0x80382dc0 (pc + 0x8)   if (s7 >= [sp + 0x50]) goto 0x80382dc0;
80382db8: 00 00 00 00  NOP

80382dbc: af b7 00 50  SW s7, sp, 0x50 (80)                [sp + 0x50] = s7;

*
80382dc0: af b1 00 54  SW s1, sp, 0x54 (84)                [sp + 0x54] = s1;

80382dc4: 8f b8 00 54  LW t8, sp, 0x54 (84)
80382dc8: 03 14 08 2a  SLT at, t8, s4
80382dcc: 10 20 00 02  BEQ r0, at, 0x80382dd8 (pc + 0x8)   if ([sp + 0x54] >= s4) goto 0x80382dd8;
80382dd0: 00 00 00 00  NOP

80382dd4: af b4 00 54  SW s4, sp, 0x54 (84)                [sp + 0x54] = s4;

*
80382dd8: 8f a9 00 54  LW t1, sp, 0x54 (84)
80382ddc: 01 37 08 2a  SLT at, t1, s7
80382de0: 10 20 00 02  BEQ r0, at, 0x80382dec (pc + 0x8)   if ([sp + 0x54] >= s7) goto 0x80382dec;
80382de4: 00 00 00 00  NOP

80382de8: af b7 00 54  SW s7, sp, 0x54 (84)                [sp + 0x54] = s7;

*
80382dec: c7 a8 00 40  LWC1 f8, sp, 0x40 (64)
80382df0: 3c 01 80 39  LUI at, 0x8039 (32825)
80382df4: d4 2a bb d0  LDC1 f10, at, 0xffffbbd0 (-17456)
80382df8: 46 00 41 a1  CVT.D.S f6, f8
80382dfc: 46 2a 30 3c  C.LT.D f6, f10
80382e00: 00 00 00 00  NOP
80382e04: 45 00 00 03  BC1F 0x80382e14 (pc + 0xc)          if ([sp + 0x40] < *(0x8038bbd0)) goto 0x80382e14;
80382e08: 00 00 00 00  NOP

80382e0c: 10 00 00 52  BEQ r0, r0, 0x80382f58 (pc + 0x148) return 0;
80382e10: 00 00 10 25  OR v0, r0, r0

*
80382e14: c7 b0 00 40  LWC1 f16, sp, 0x40 (64)
80382e18: 3c 01 3f f0  LUI at, 0x3ff0 (16368)
80382e1c: 44 81 98 00  MTC1 at, f19                            010001 00100 00001 10011 00000000000
80382e20: 44 80 90 00  MTC1 r0, f18                            010001 00100 00000 10010 00000000000
80382e24: 46 00 81 21  CVT.D.S f4, f16                         010001 10000 00000 10000 00100 100001
80382e28: 46 24 92 03  DIV.D f8, f18, f4                       010001 10001 00100 10010 01000 000011
80382e2c: 46 20 41 a0  CVT.S.D f6, f8
80382e30: e7 a6 00 40  SWC1 f6, sp, 0x40 (64)              [sp + 0x40] = (float)(1.0 / (double)[sp + 0x40]);

80382e34: c7 aa 00 4c  LWC1 f10, sp, 0x4c (76)
80382e38: c7 b0 00 40  LWC1 f16, sp, 0x40 (64)
80382e3c: 46 10 54 82  MUL.S f18, f10, f16
80382e40: e7 b2 00 4c  SWC1 f18, sp, 0x4c (76)             [sp + 0x4c] *= [sp + 0x40];

80382e44: c7 a4 00 48  LWC1 f4, sp, 0x48 (72)
80382e48: c7 a8 00 40  LWC1 f8, sp, 0x40 (64)
80382e4c: 46 08 21 82  MUL.S f6, f4, f8
80382e50: e7 a6 00 48  SWC1 f6, sp, 0x48 (72)              [sp + 0x48] *= [sp + 0x40];

80382e54: c7 aa 00 44  LWC1 f10, sp, 0x44 (68)
80382e58: c7 b0 00 40  LWC1 f16, sp, 0x40 (64)
80382e5c: 46 10 54 82  MUL.S f18, f10, f16
80382e60: e7 b2 00 44  SWC1 f18, sp, 0x44 (68)             [sp + 0x44] *= [sp + 0x40];

80382e64: 0c 0e 09 3e  JAL 0x803824f8 (-2143804168)        [sp + 0x7c] = 0x803824f8();
80382e68: 00 00 00 00  NOP
80382e6c: af a2 00 7c  SW v0, sp, 0x7c (124)

80382e70: 8f aa 00 7c  LW t2, sp, 0x7c (124)
80382e74: a5 50 00 0a  SH s0, t2, 0xa (10)                 [sp + 0x7c]->off0x0a = s0;

80382e78: 8f ad 00 7c  LW t5, sp, 0x7c (124)
80382e7c: a5 b3 00 10  SH s3, t5, 0x10 (16)                [sp + 0x7c]->off0x10 = s3;

80382e80: 8f af 00 7c  LW t7, sp, 0x7c (124)
80382e84: a5 f6 00 16  SH s6, t7, 0x16 (22)                [sp + 0x7c]->off0x16 = s6;

80382e88: 8f ab 00 7c  LW t3, sp, 0x7c (124)
80382e8c: a5 71 00 0c  SH s1, t3, 0xc (12)                 [sp + 0x7c]->off0x0c = s1;

80382e90: 8f ac 00 7c  LW t4, sp, 0x7c (124)
80382e94: a5 94 00 12  SH s4, t4, 0x12 (18)                [sp + 0x7c]->off0x12 = s4;

80382e98: 8f b9 00 7c  LW t9, sp, 0x7c (124)
80382e9c: a7 37 00 18  SH s7, t9, 0x18 (24)                [sp + 0x7c]->off0x18 = s7;

80382ea0: 8f ae 00 7c  LW t6, sp, 0x7c (124)
80382ea4: a5 d2 00 0e  SH s2, t6, 0xe (14)                 [sp + 0x7c]->off0x0e = s2;

80382ea8: 8f a8 00 7c  LW t0, sp, 0x7c (124)
80382eac: a5 15 00 14  SH s5, t0, 0x14 (20)                [sp + 0x7c]->off0x14 = s5;

80382eb0: 8f b8 00 58  LW t8, sp, 0x58 (88)
80382eb4: 8f a9 00 7c  LW t1, sp, 0x7c (124)
80382eb8: a5 38 00 1a  SH t8, t1, 0x1a (26)                [sp + 0x7c]->off0x1a = [sp + 0x58];

80382ebc: c7 a4 00 4c  LWC1 f4, sp, 0x4c (76)
80382ec0: 8f aa 00 7c  LW t2, sp, 0x7c (124)
80382ec4: e5 44 00 1c  SWC1 f4, t2, 0x1c (28)              [sp + 0x7c]->off0x1c = [sp + 0x4c];

80382ec8: c7 a8 00 48  LWC1 f8, sp, 0x48 (72)
80382ecc: 8f ad 00 7c  LW t5, sp, 0x7c (124)
80382ed0: e5 a8 00 20  SWC1 f8, t5, 0x20 (32)              [sp + 0x7c]->off0x20 = [sp + 0x48];

80382ed4: c7 a6 00 44  LWC1 f6, sp, 0x44 (68)
80382ed8: 8f af 00 7c  LW t7, sp, 0x7c (124)
80382edc: e5 e6 00 24  SWC1 f6, t7, 0x24 (36)              [sp + 0x7c]->off0x24 = [sp + 0x44];

80382ee0: 44 90 50 00  MTC1 s0, f10
80382ee4: 44 91 30 00  MTC1 s1, f6
80382ee8: c7 b2 00 4c  LWC1 f18, sp, 0x4c (76)
80382eec: 46 80 54 20  CVT.S.W f16, f10
80382ef0: c7 a8 00 48  LWC1 f8, sp, 0x48 (72)
80382ef4: 8f ab 00 7c  LW t3, sp, 0x7c (124)
80382ef8: 46 80 32 a0  CVT.S.W f10, f6
80382efc: 46 12 81 02  MUL.S f4, f16, f18                      f4 = ((float)s0) * [sp + 0x4c]
80382f00: c7 a6 00 44  LWC1 f6, sp, 0x44 (68)
80382f04: 46 0a 44 02  MUL.S f16, f8, f10                      f16 = [sp + 0x48] * ((float)s1)
80382f08: 44 92 40 00  MTC1 s2, f8
80382f0c: 00 00 00 00  NOP
80382f10: 46 80 42 a0  CVT.S.W f10, f8
80382f14: 46 10 24 80  ADD.S f18, f4, f16                      f18 = ((float)s0) * [sp + 0x4c] + [sp + 0x48] * ((float)s1)
80382f18: 46 0a 31 02  MUL.S f4, f6, f10                       f4 = [sp + 0x44] * ((float)s2)
80382f1c: 46 04 94 00  ADD.S f16, f18, f4                      f16 = ((float)s0) * [sp + 0x4c] + [sp + 0x48] * ((float)s1) + [sp + 0x44] * ((float)s2)
80382f20: 46 00 82 07  NEG.S f8, f16
80382f24: e5 68 00 28  SWC1 f8, t3, 0x28 (40)              [sp + 0x7c]->off0x28 = -(((float)s0) * [sp + 0x4c] + [sp + 0x48] * ((float)s1) + [sp + 0x44] * ((float)s2));

80382f28: 8f ac 00 50  LW t4, sp, 0x50 (80)
80382f2c: 8f ae 00 7c  LW t6, sp, 0x7c (124)
80382f30: 25 99 ff fb  ADDIU t9, t4, 0xfffffffb (-5)
80382f34: a5 d9 00 06  SH t9, t6, 0x6 (6)                  [sp + 0x7c]->off0x06 = [sp + 0x50]-5;

80382f38: 8f a8 00 54  LW t0, sp, 0x54 (84)
80382f3c: 8f a9 00 7c  LW t1, sp, 0x7c (124)
80382f40: 25 18 00 05  ADDIU t8, t0, 0x5 (5)
80382f44: a5 38 00 08  SH t8, t1, 0x8 (8)                  [sp + 0x7c]->off0x08 = [sp + 0x54]+5;

80382f48: 10 00 00 03  BEQ r0, r0, 0x80382f58 (pc + 0xc)
80382f4c: 8f a2 00 7c  LW v0, sp, 0x7c (124)               return [sp + 0x7c];
80382f50: 10 00 00 01  BEQ r0, r0, 0x80382f58 (pc + 0x4)
80382f54: 00 00 00 00  NOP

80382f58: 8f bf 00 34  LW ra, sp, 0x34 (52)
80382f5c: 8f b0 00 14  LW s0, sp, 0x14 (20)
80382f60: 8f b1 00 18  LW s1, sp, 0x18 (24)
80382f64: 8f b2 00 1c  LW s2, sp, 0x1c (28)
80382f68: 8f b3 00 20  LW s3, sp, 0x20 (32)
80382f6c: 8f b4 00 24  LW s4, sp, 0x24 (36)
80382f70: 8f b5 00 28  LW s5, sp, 0x28 (40)
80382f74: 8f b6 00 2c  LW s6, sp, 0x2c (44)
80382f78: 8f b7 00 30  LW s7, sp, 0x30 (48)
80382f7c: 03 e0 00 08  JR ra
80382f80: 27 bd 00 80  ADDIU sp, sp, 0x80 (128)


[sp + 0x3e] = (*arg2)[0] *3;
[sp + 0x3c] = (*arg2)[1] *3;
[sp + 0x3a] = (*arg2)[2] *3;
s0 = arg1[[sp + 0x3e]];
s1 = arg1[[sp + 0x3e] + 1];
s2 = arg1[[sp + 0x3e] + 2];
s3 = arg1[[sp + 0x3c]];
s4 = arg1[[sp + 0x3c] + 1];
s5 = arg1[[sp + 0x3c] + 2];
s6 = arg1[[sp + 0x3a]];
s7 = arg1[[sp + 0x3a] + 1];
[sp + 0x58] = arg1[[sp + 0x3a] + 2];
[sp + 0x4c] = (float)((s4 - s1)*([sp + 0x58] - s5)-(s5 - s2)*(s7 - s4));
[sp + 0x48] = (float)((s5 - s2)*(s6 - s3) - (s3 - s0)*([sp + 0x58] - s5));
[sp + 0x44] = (float)((s3 - s0)*(s7 - s4) - (s4 - s1)*(s6 - s3));
[sp + 0x40] = sqrt([sp + 0x4c]*[sp + 0x4c] + [sp + 0x48]*[sp + 0x48] + [sp + 0x68]*[sp + 0x68]);
[sp + 0x50] = s1;
if (s4 >= [sp + 0x50]) goto 0x80382dac;
[sp + 0x50] = s4;
80382dac:
if (s7 >= [sp + 0x50]) goto 0x80382dc0;
[sp + 0x50] = s7;
80382dc0:
[sp + 0x54] = s1;
if ([sp + 0x54] >= s4) goto 0x80382dd8;
[sp + 0x54] = s4;
80382dd8:
[sp + 0x54] = s7;
80382dec:
if ([sp + 0x40] < *(0x8038bbd0)) goto 0x80382e14;
return 0;
80382e14:
[sp + 0x40] = (float)(1.0 / (double)[sp + 0x40]);
[sp + 0x4c] *= [sp + 0x40];
[sp + 0x48] *= [sp + 0x40];
[sp + 0x44] *= [sp + 0x40];
[sp + 0x7c] = 0x803824f8();
[sp + 0x7c]->off0x0a = s0;
[sp + 0x7c]->off0x10 = s3;
[sp + 0x7c]->off0x16 = s6;
[sp + 0x7c]->off0x0c = s1;
[sp + 0x7c]->off0x12 = s4;
[sp + 0x7c]->off0x18 = s7;
[sp + 0x7c]->off0x0e = s2;
[sp + 0x7c]->off0x14 = s5;
[sp + 0x7c]->off0x1a = [sp + 0x58];
[sp + 0x7c]->off0x1c = [sp + 0x4c];
[sp + 0x7c]->off0x20 = [sp + 0x48];
[sp + 0x7c]->off0x24 = [sp + 0x44];
[sp + 0x7c]->off0x28 = -(((float)s0) * [sp + 0x4c] + [sp + 0x48] * ((float)s1) + [sp + 0x44] * ((float)s2));
[sp + 0x7c]->off0x06 = [sp + 0x50]-5;
[sp + 0x7c]->off0x08 = [sp + 0x54]+5;
return [sp + 0x7c];



[sp + 0x3e]     pti1
[sp + 0x3c]     pti2
[sp + 0x3a]     pti3
s0              x0
s1              y0
s2              z0
s3              x1
s4              y1
s5              z1
s6              x2
s7              y2
[sp + 0x58]     z2
[sp + 0x4c]     normx
[sp + 0x48]     normy
[sp + 0x44]     normz
[sp + 0x40]     m
[sp + 0x50]     ymin
[sp + 0x54]     ymax
[sp + 0x7c]     ptr


typedef struct tagRTSOLIDITY {
    short command;     /* 2    @ 0x00 */
    short extra;       /* 2    @ 0x02 */
    char  unknown1     /* 1    @ 0x04 */
    char  unknown2     /* 1    @ 0x05 */
    short ymin         /* 2    @ 0x06 */
    short ymax         /* 2    @ 0x08 */
    short pts[3][3];   /* 0x12 @ 0x0a */
    float norm[3]      /* 0x0c @ 0x1c */
    float negdot       /* 4    @ 0x28 */
    ??    unknown3     /* 4    @ 0x2c */
} RTSOLIDITY;          /* TOTAL: 0x30 */


RTSOLIDITY * 0x80382b7c(short *pverts, short **pwp)
{
    pti1 = (*pwp)[0] *3;
    pti2 = (*pwp)[1] *3;
    pti3 = (*pwp)[2] *3;
    x0 = pverts[pti1    ];
    y0 = pverts[pti1 + 1];
    z0 = pverts[pti1 + 2];
    x1 = pverts[pti2    ];
    y1 = pverts[pti2 + 1];
    z1 = pverts[pti2 + 2];
    x2 = pverts[pti3    ];
    y2 = pverts[pti3 + 1];
    z2 = pverts[pti3 + 2];
    normx = (float)((y1 - y0)*(z2 - z1) - (z1 - z0)*(y2 - y1));
    normy = (float)((z1 - y0)*(x2 - x1) - (x1 - x0)*(z2 - z1));
    normz = (float)((x1 - x0)*(y2 - y1) - (y1 - y0)*(x2 - x1));
    m = sqrt(normx*normx + normy*normy + normz*normz);
    
    ymin = y0;
    if (y1 < ymin) {
        ymin = y1;
    }
    if (y2 < ymin) {
        ymin = y2;
    }
    
    ymax = y0;
    if (ymax < y1) {
        ymax = y1;
    }
    if (ymax < y2) {
        ymax = y2;
    }
    
    if (m >= *(0x8038bbd0)) {
        return 0;
    }
    
    m = (float)(1.0 / ((double)m));
    normx *= m;
    normy *= m;
    normz *= m;
    ptr = 0x803824f8();
    ptr->pts[0][0] = x0;
    ptr->pts[1][0] = x1;
    ptr->pts[2][0] = x2;
    ptr->pts[0][1] = y0;
    ptr->pts[1][1] = y1;
    ptr->pts[2][1] = y2;
    ptr->pts[0][2] = z0;
    ptr->pts[1][2] = z1;
    ptr->pts[2][2] = z2;
    ptr->norm[0] = normx;
    ptr->norm[1] = normy;
    ptr->norm[2] = normz;
    ptr->negdot = -(normx*((float)x0) + normy*((float)y0) + normz*((float)z0));
    ptr->ymin = ymin-5;
    ptr->ymax = ymax+5;
    return ptr;
}
